# # ----案例：学生类----
# # 编写一个学生类：
# # 属性：姓名、性别、类别默认为people
# # 方法：hello
# class Student:
#     category="people"
#     def __init__(self,name,sex):
#         self.name=name
#         self.sex=sex
#     def hello(self):
#         print("hello")
# student1=Student("小红","girl")
# print(student1.sex)
# student1.hello()
'''----封装案例：学生类----
编写一个学生类：
属性：姓名、性别、类别默认为people
方法：hello
封装属性：年龄
增加方法：显示年龄、设置年龄'''
class Student:
    category = "people"
    def __init__(self,name,sex,age):
        self.name=name
        self.sex=sex
        self.age=age
    def hello(self):
        print("hello")
    def age(self):
        print()

student1=Student("小红","girl","28")
